package com.ruoyi.business.controller.user;

import com.ruoyi.business.service.ITRegisterPersonService;
import com.ruoyi.business.vo.TRegisterNoticeVo;
import com.ruoyi.common.annotation.RateLimiter;
import com.ruoyi.common.core.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Tellsea
 * @date 2024/1/26
 */
@Api(tags = "通用Controller")
@RestController
@RequestMapping("/au/registerBase")
@RequiredArgsConstructor(onConstructor_ = @Autowired)
public class AuRegisterBaseController {

    private final ITRegisterPersonService registerPersonService;

    @ApiOperation("最新一条报名信息")
    @GetMapping("/getLast")
    public AjaxResult getLast() {
        return registerPersonService.getLast();
    }

    @ApiOperation("报到")
    @PostMapping("/saveSure")
    @RateLimiter
    public AjaxResult saveSure(@RequestBody TRegisterNoticeVo entity) {
        return registerPersonService.saveSure(entity);
    }
}
